home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2958 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.7 KB

  1. Path: news1.h1.usa.pipeline.com!usenet
  2. From: grantp@usa.pipeline.com
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: a lady need help
  5. Date: 20 Jan 1996 22:38:13 GMT
  6. Organization: Kalevi, Inc.
  7. Message-ID: <4drqsl$fjo@news1.usa.pipeline.com>
  8. NNTP-Posting-Host: pipe11.h1.usa.pipeline.com
  9. X-PipeUser: grantp
  10. X-PipeHub: usa.pipeline.com
  11. X-PipeGCOS: (Pete)
  12. X-Newsreader: Pipeline USA v3.3.0
  13.  
  14. On Jan 20, 1996 21:09:53 in article <a lady need help>, 'linda siu
  15. <103051.3457@CompuServe.COM>' wrote: 
  16.  
  17.  
  18. >I lost my job and went for an interview lately. 
  19. >I am still confuse about some of the c++ question. 
  20. Was the job for a c++ programmer?  Your questions are rather 
  21. basic in natue -- nothing wrong with that, we all had to learn 
  22. in the beginning -- indicate that you may want to stick to just 
  23. straight C jobs for the time being.  Of course, the fact that you're 
  24. checking this newsgroup shows progress ::--)).  In the right 
  25. direction, I might add.  
  26.   
  27. >a)  What is a initialization list and when/how to use it. 
  28. An initialization list is used to specify values to be assigned 
  29. to the data members of an object at creation time.  In some 
  30. cases, initialization list is required, in others it's just a convenience. 
  31. For more info, consult any C++ book. 
  32.  
  33. >b) what is the advantage of new/delete over malloc/free. 
  34. malloc() only allocates raw memory.  Any initializations for such 
  35. memory must be performed explicitly after allocation.  The new 
  36. operator, on the other hand, not only allocates raw memory, but 
  37. calls the applicable initializations on that memory to turn it into 
  38. a bona-fide object.  Again, for more info, consult any basic C++ 
  39. text. 
  40.  
  41. -- 
  42. Pete Grant 
  43. Kalevi, Inc. 
  44. Object Oriented Software Development
  45.